package com.ruoyi.purchase.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.purchase.domain.Brand;
import com.ruoyi.purchase.domain.Firm;
import com.ruoyi.purchase.domain.Product;
import com.ruoyi.purchase.domain.Type;
import com.ruoyi.purchase.service.ProductService;
import com.ruoyi.purchase.mapper.ProductMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author lenovo
* @description 针对表【po_product】的数据库操作Service实现
* @createDate 2022-01-07 14:49:26
*/
@Service
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product>
    implements ProductService{

    @Autowired
    private ProductMapper productMapper;

    @Override
    public List<Product> findAllProduct(Product product) {
        return productMapper.findAllProduct(product);
    }

    @Override
    public List<Product> queryList(Product product) {
        return productMapper.findAllProduct(product);
    }

    @Override
    public int changeStatus(Product product) {
        return productMapper.updateUser(product);
    }

    @Override
    public Product selectProductById(Integer productId) {
        return productMapper.selectProductById(productId);
    }

    @Override
    public List<Firm> selectFirm() {
        return productMapper.selectFirm();
    }

    @Override
    public List<Type> selectType() {
        return productMapper.selectType();
    }

    @Override
    public List<Brand> selectBrand() {
        return productMapper.selectBrand();
    }
    @Override
    public Product findByBrandTypeModel(String productModel) {
        return productMapper.findByBrandTypeModel(productModel);
    }
}




